import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";

//设计交底-分页
export function pageDesignBriefing(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/designBriefing/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计交底-保存
export function saveDesignBriefing(data) {
  return axios({
    url: baseUrl + `/probusiness/designBriefing/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计交底-详情
export function detailDesignBriefing(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designBriefing/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计交底-删除
export function deleteDesignBriefing(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designBriefing/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//设计交底-下载压缩包
export function zipDesignBriefing(data) {
  return axios({
    url: baseUrl + `/probusiness/designBriefing/exportZipByFileIds`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}

//设计交底-上传-下载压缩包
export function exportZip67(data) {
  return axios({
    url: baseUrl + `/probusiness/bimCadProject/exportZip67`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}
//设计交底-提交
export function submitDesignBriefing(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designBriefing/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//设计交底-审批
export function approveDesignBriefing(data) {
  return axios({
    url: baseUrl + `/probusiness/designBriefing/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计变更-分页
export function pageDesignChange(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/designChange/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计变更-保存
export function saveDesignChange(data) {
  return axios({
    url: baseUrl + `/probusiness/designChange/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//设计变更-详情
export function detailDesignChange(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designChange/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计变更-提交
export function submitDesignChange(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designChange/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计变更-审批
export function approveDesignChange(data) {
  return axios({
    url: baseUrl + `/probusiness/designChange/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//设计变更-删除
export function deleteDesignChange(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/designChange/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//封样管理-分页
export function pageSealSampleManage(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/sampleSealingManagement/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//封样管理-保存
export function saveSealSampleManage(data) {
  return axios({
    url: baseUrl + `/probusiness/sampleSealingManagement/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//封样管理-详情
export function detailSealSampleManage(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/sampleSealingManagement/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//封样管理-删除
export function deleteSealSampleManage(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/sampleSealingManagement/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//封样管理-提交
export function submitSealSampleManage(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/sampleSealingManagement/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//封样管理-审批
export function approveSealSampleManage(data) {
  return axios({
    url: baseUrl + `/probusiness/sampleSealingManagement/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//封样管理-更新施工封样图片
export function updateConstructionSealingSample(data) {
  return axios({
    url:
      baseUrl +
      `/probusiness/sampleSealingManagement/updateConstructionSealingSample`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//图纸会审-分页
export function pageDrawingReview(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/drawingReview/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审-删除
export function deleteDrawingReview(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/drawingReview/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审-保存
export function saveDrawingReview(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReview/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审-详情
export function detailDrawingReview(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/drawingReview/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审-审批
export function approveDrawingReview(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReview/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审-提交
export function submitDrawingReview(data) {
  let { uuid, userList } = data;
  return axios({
    url: baseUrl + `/probusiness/drawingReview/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data: {
      userList,
    },
  });
}

//参会人员下拉框
export function participantsList(params) {
  return axios({
    url: baseUrl + `/probusiness/sysUser/getOrgUserTree`,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//图纸会审批注-分页
export function pageAnnotations(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/drawingReviewComment/getPageSet?pageNo=${page}&pageSize=${pageSize}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//图纸会审批注-最新的三条
export function newThreeList(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReviewComment/getList3`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//图纸会审批注-删除
export function deleteAnnotations(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/drawingReviewComment/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审批注-详情
export function detailAnnotations(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/drawingReviewComment/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审批注-查询头部详情
export function headerAnnotations(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReviewComment/getPageHeader`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//图纸会审批注-处理
export function saveIssueAnnotations(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReviewComment/dealIssue`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//图纸会审-审批
export function approveAnnotations(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReview/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//图纸会审-问题清单、处理意见表【下载】
export function downloadDrawingReview(data) {
  return axios({
    url: baseUrl + `/probusiness/drawingReview/downloadData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}

//施工图审图-动态表头
export function getDrawingReviewHeader(data) {
  return axios({
    url: baseUrl + `/probusiness/constructionDrawingReview/getTableHead`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工图审图-列表数据
export function pageDrawingReviewBody(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/constructionDrawingReview/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工图审图-【删除】
export function deleteConstructionDrawingReview(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/constructionDrawingReview/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//施工图审图-【新增详情】
export function getConstructionDrawingReviewConfigField(data = {}) {
  return axios({
    url: baseUrl + `/probusiness/constructionDrawingReview/initConfigField`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工图审图-详情
export function detailConstructionDrawingReview(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/constructionDrawingReview/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工图审图-保存
export function saveConstructionDrawingReview(data) {
  return axios({
    url: baseUrl + `/probusiness/constructionDrawingReview/updateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//施工图审图一级目录-下载压缩包
export function exportConstructionDrawingReview(data) {
  let { classifyId, uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/constructionDrawingReview/exportZip?classifyId=${classifyId}&uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data: {},
  });
}
//施工图审图一级目录-普通文件压缩包
export function exportZipByFileIds(data) {
  return axios({
    url: baseUrl + `/probusiness/designBriefing/exportZipByFileIds`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}

//查询关联模型列表
export function getModalList(data) {
  let { proCode, type } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/bimCadClassify/getModelTreeByProCode?proCode=${proCode}&type=${type}`,
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    method: "POST",
    data: {},
  });
}
//总计划管控-合同分解表下载
export function downloadContractDecompose(params) {
  return axios({
    url: baseUrl + `/probusiness/contractDecompose/exportData.api`,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    apiType: "file",
    responseType: "arraybuffer",
    params,
  });
}
